#ifndef __MR_H_
#define __MR_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

volatile const uint16_t DE_CURVE[256] = {
	17039,17502,18215,19155,20296,21609,23065,24631,26276,
	27967,29673,31362,33007,34580,36056,37412,38632,39697,
	40596,41321,41864,42226,42405,42408,42241,41913,41439,
	40831,40106,39282,38377,37411,36403,35373,34339,33320,
	32334,31396,30521,29722,29009,28392,27878,27471,27173,
	26987,26910,26940,27071,27297,27610,28000,28459,28974,
	29535,30130,30747,31373,31999,32612,33202,33761,34279,
	34749,35164,35520,35813,36041,36201,36294,36321,36285,
	36188,36035,35830,35581,35291,34970,34623,34257,33881,
	33500,33123,32754,32401,32069,31763,31488,31246,31041,
	30875,30749,30664,30619,30615,30648,30717,30819,30952,
	31111,31293,31493,31707,31931,32161,32391,32619,32840,
	33051,33248,33428,33589,33730,33847,33941,34010,34054,
	34074,34070,34043,33995,33927,33842,33741,33627,33503,
	33371,33234,33094,32954,32817,32685,32559,32443,32337,
	32242,32161,32094,32042,32005,31982,31974,31981,32001,
	32034,32078,32133,32197,32268,32345,32426,32510,32595,
	32679,32762,32841,32915,32984,33047,33101,33148,33186,
	33215,33235,33246,33248,33242,33227,33205,33176,33141,
	33101,33057,33010,32960,32909,32857,32806,32757,32709,
	32665,32624,32588,32556,32529,32508,32492,32481,32476,
	32477,32482,32492,32507,32526,32548,32573,32600,32629,
	32660,32691,32722,32753,32783,32811,32837,32861,32882,
	32901,32916,32928,32937,32942,32944,32943,32939,32932,
	32922,32910,32897,32881,32864,32846,32827,32808,32789,
	32771,32753,32736,32721,32707,32694,32684,32675,32668,
	32664,32661,32660,32661,32664,32669,32676,32683,32692,
	32702,32712,32723,32735,32746,32758,32769,32779,32789,
	32798,32807,32814

};


typedef enum 
{
    Disengagement,
    Demagnetization,
    Engagement
} MR_State;

typedef struct
{
    /* data */
    MR_State state;
    uint32_t wave_val;

}MR_Cmd;



#ifdef __cplusplus
}
#endif

#endif // __MR_H_
